/* 游戏列表页面样式 */

/* 主要内容布局 */
.main {
    padding: 2rem 1rem;
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    min-height: calc(100vh - 70px - 300px); /* 减去头部和底部的高度 */
    margin-top: 70px; /* 添加顶部边距以避免与导航栏重叠 */
}

/* 筛选器部分 */
.filters-section {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 90px;
}

.filter-group {
    margin-bottom: 2rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group h3 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.filter-option:hover {
    color: var(--text-primary);
}

.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--text-secondary);
    appearance: none;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.filter-option input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.filter-option input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.filter-option .count {
    margin-left: auto;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 游戏列表部分 */
.games-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.games-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.games-count {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.games-count span {
    color: var(--primary-color);
    font-weight: 700;
}

.games-sort select {
    background-color: var(--surface-color);
    border: none;
    color: var(--text-primary);
    padding: 0.5rem 2rem 0.5rem 1rem;
    border-radius: var(--radius-sm);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    cursor: pointer;
}

.games-sort select:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 0.5rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.page-btn:disabled {
    color: var(--text-secondary);
    cursor: not-allowed;
}

.page-btn:not(:disabled):hover {
    background-color: var(--surface-color);
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.page-number {
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.page-number:hover {
    background-color: var(--surface-color);
}

.page-number.active {
    background-color: var(--primary-color);
    color: white;
}

.page-ellipsis {
    color: var(--text-secondary);
    padding: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main {
        grid-template-columns: 240px 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .main {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .filters-section {
        position: static;
        margin-bottom: 1rem;
    }

    .filter-options {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .games-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .games-sort {
        width: 100%;
    }

    .games-sort select {
        width: 100%;
    }
}

/* 游戏卡片额外样式 */
.game-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.game-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--accent-color);
    color: var(--background-color);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}
